package com.njworkorder.Service.Impl;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.njworkorder.Entity.*;
import com.njworkorder.Service.DiseaseRegistrationService;
import com.njworkorder.Mapper.DiseaseRegistrationMapper;
import com.njworkorder.VO.AssignmentProgressVos.DRInfo;
import com.njworkorder.VO.DiseaseRegistrationListVo;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
* @author iron
* @description 针对表【disease_registration】的数据库操作Service实现
* @createDate 2024-11-11 13:44:40
*/
@Service
public class DiseaseRegistrationServiceImpl extends MPJBaseServiceImpl<DiseaseRegistrationMapper, DiseaseRegistration>
    implements DiseaseRegistrationService{

    @Override
    public MPJLambdaWrapper<DiseaseRegistration> getMPJWrapper() {
        return new MPJLambdaWrapper<DiseaseRegistration>()
                .selectAll(DiseaseRegistration.class)
                .leftJoin(InspectionRegistration.class, InspectionRegistration::getId, DiseaseRegistration::getInspectionRegistrationId)
                .leftJoin(Workspace.class, Workspace::getId, InspectionRegistration::getWorkspaceId, ext ->
                        ext.selectAs(Workspace::getWorkspaceName, DiseaseRegistrationListVo::getWorkspaceName))
                .leftJoin(Section.class, Section::getId, InspectionRegistration::getSectionId, ext ->
                        ext.selectAs(Section::getSectionName, DiseaseRegistrationListVo::getSectionName))
                .leftJoin(Disease.class, Disease::getId, DiseaseRegistration::getDisease, ext ->
                        ext.selectAs(Disease::getDiseaseName, DiseaseRegistrationListVo::getDiseaseName)
                                .selectAs(Disease::getPredictUnit, DiseaseRegistrationListVo::getPredictUnit));
    }
}




